package main.java.decorator;

/**
 * 具体装饰者类
 */
public class Egg extends Garnish {
    FastFood fastFood;


    public Egg(FastFood fastFood) {
        super(fastFood, 1, "鸡蛋");
    }


    @Override
    float cost() {
        //计算价格
        return getPrice() + getFastFood().cost();
    }

    @Override
    public String getDesc() {
        return super.getDesc() + getFastFood().getDesc();
    }
}
